package com.osmino.core;

import android.content.DialogInterface;
import android.widget.EditText;
import com.osmino.core.DialogGenerator.DialogHost;

public final class TextPickerDialogCallback extends DialogCallback {

	private EditText mEditText;

	public TextPickerDialogCallback(DialogHost dialogHost, int dialogId, TextPickerDialog dialog) {
		super(dialogHost, dialogId);
		mEditText = dialog.getEditText();
	}

	@Override
	protected DialogInfo createDialogInfo(DialogInterface dialog, int which) {
		DialogInfo dialogInfo = new DialogInfo(mDialogId, which);
		dialogInfo.text = mEditText.getText().toString().trim();
		return dialogInfo;
	}

}
